<?php
	require_once('../modele/Utilisateur.class.php');
	require_once('../acces_donnees/AccesDonneesUtilisateur.class.php');
	require_once('../acces_donnees/AccesDonneesProjet.class.php');
	require_once('../acces_donnees/AccesDonneesActivite.class.php');

	if (!empty($_SESSION['utilisateur']) && !empty($_GET['page']) && !empty($_GET['id']))
	{
	?>

<div id="contenu">
	<div class="titre_contenu_ajouter"><div class="texte_titre_contenu_activite"><strong>Modifier l'activité</strong></div></div>
		<form action="../controleur/c_modifier_activite.php" method="post">
			<div class="fond_label_activite">
				<label class="label_activite"><strong>Nom de l'activité : </strong></label>
					<input type="text" name="nom_activite" class="champ_nom_activite" value="<?php echo $_SESSION['accesActiviteSelection'][$_GET['sessiontab']]['actv_label']; ?>"/>
			</div>

			<div class="fond_label_activite">
				<label class="label_activite"><strong>Priorité de l'activité : </strong></label>
					<select name="priorite_activite" id="priorite_activite" class="liste_activite_priorite">
					<?php
						$prioriteActivite = array("Basse","Moyenne","Haute","Urgente");
						$cleARechercher = array_search($_SESSION['accesActiviteSelection'][$_GET['sessiontab']]['actv_priorite'], $prioriteActivite);
						unset($prioriteActivite[$cleARechercher]);
						
						echo '<option value="'.$_SESSION['accesActiviteSelection'][$_GET['sessiontab']]['actv_priorite'].'">'.$_SESSION['accesActiviteSelection'][$_GET['sessiontab']]['actv_priorite'].'</option>';
						foreach ($prioriteActivite as $priorite)
						{
							echo '<option value="'.$priorite.'">'.$priorite.'</option>';
						}
					?>
				</select>
			</div>

			<div class="fond_label_activite">
				<label class="label_activite"><strong>Echéance de l'activité : </strong></label>
					<input type="text" name="date_echeance_activite" class="champ_date_echeance_activite" id="datepicker"
					value="<?php echo $_SESSION['accesActiviteSelection'][$_GET['sessiontab']]['actv_date_echeance']; ?>"/>
			</div>

			<div class="fond_label_activite">
				<label class="label_activite"><strong>Etat de l'activité : </strong></label>
					<select name="etat_activite" id="priorite_activiter" class="liste_etat_activite">
						
					<?php
						$etatActivite = array("En cours","Achevé");
						$cleARechercher = array_search($_SESSION['accesActiviteSelection'][$_GET['sessiontab']]['actv_etat'], $etatActivite);
						unset($etatActivite[$cleARechercher]);
						
						echo '<option value="'.$_SESSION['accesActiviteSelection'][$_GET['sessiontab']]['actv_etat'].'">'.$_SESSION['accesActiviteSelection'][$_GET['sessiontab']]['actv_etat'].'</option>';
						foreach ($etatActivite as $etat)
						{
							echo '<option value="'.$etat.'">'.$etat.'</option>';
						}
					?>
						
					</select>
				
				<input type="hidden" name="date_creation_activite" value="<?php echo $_SESSION['accesActiviteSelection'][$_GET['sessiontab']]['actv_date_creation']; ?>"/>
				<input type="hidden" name="id_activite" value="<?php echo $_SESSION['accesActiviteSelection'][$_GET['sessiontab']]['actv_id']; ?>"/>
				<input type="submit" value="modifier cette activité"/>
			</div>

			<div class="fond_label_activite">
				
			</div>
		</form>
</div>
<script type="text/javascript"> $(function() { $( "#datepicker" ).datepicker(); }); </script>
	<?php
	}
?>

